import {httpForm, httpJson} from "@/request/http";
const getLoanConfig = (params) => { // 获取质押配置
    return httpForm(
        {
            url: "/api/loan!getLoanConfig.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const orderList = (params) => { // 质押借币订单
    return httpForm(
        {
            url: "/api/loan!orderList.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const addOrder = (params) => { // 借币
    return httpForm(
        {
            url: "/api/loan!addOrder.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const getLoanParam = (params) => { // 质押借币获取页面参数
    return httpForm(
        {
            url: "/api/loan!getLoanParam.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const relationOrderList = (params) => { // 质押记录
    return httpForm(
        {
            url: "/api/loan!relationOrderList.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const replenishOrder = (params) => { // 补增质押
    return httpForm(
        {
            url: "/api/loan!replenishOrder.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const refurbishOrder = (params) => { // 续借
    return httpForm(
        {
            url: "/api/loan!refurbishOrder.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const repayOrder = (params) => { // 还款
    return httpForm(
        {
            url: "/api/loan!repayOrder.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

const getOrder = (params) => { // 质押借币详情
    return httpForm(
        {
            url: "/api/loan!getOrder.action",
            method: "post",
            isLoading: false,
        },
        params
    );
};

export default {
    getLoanConfig,
    orderList,
    addOrder,
    getLoanParam,
    relationOrderList,
    replenishOrder,
    refurbishOrder,
    repayOrder,
    getOrder
};
